# _*_ coding:utf-8 _*_
from pages.base_page import BasePage
from selenium.webdriver.common.by import By


# pages/login_page.py,页面对象模型，子类，继承base_page,存放具体的页面属性
class LoginPage(BasePage):
    USERNAME_INPUT = (By.ID, "account")
    PASSWORD_INPUT = (By.ID, "password")
    LOGIN_BUTTON = (By.XPATH, '/html/body/div[2]/div/user-layout/user-content/user-form-wrapper/div[2]/button')

    def login(self, username, password, model):
        self.send_keys(self.USERNAME_INPUT[0],self.USERNAME_INPUT[1], username, model)
        self.send_keys(self.PASSWORD_INPUT[0],self.PASSWORD_INPUT[1], password, model)
        self.click(self.LOGIN_BUTTON[0],self.LOGIN_BUTTON[1],'登录')
